Skip to content

First cut changes for commit.#29

Open
nitin-deamon wants to merge 9 commits intomainfrom
personal/nitinsingla/commit-with-inline
Open

First cut changes for commit.#29
nitin-deamon wants to merge 9 commits intomainfrom
personal/nitinsingla/commit-with-inline

Conversation

@nitin-deamon
Copy link
Collaborator

No description provided.

@nitin-deamon nitin-deamon force-pushed the personal/nitinsingla/commit-with-inline branch from 202154b to 9d545d1 Compare January 28, 2025 03:03
- audited file_cache.h
*/
inode->mark_commit_in_progress();

assert(inode->is_commit_in_progress());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this assert can theoretically fail if commit completes before we come here

* As we already 1GB worth of dirty data in the cache, we don't want
* to add more data to the cache. So we wait for the ongoing flush/commit.
*/
if (inode->is_commit_in_progress()) {
Copy link
Owner

@linuxsmiths linuxsmiths Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit_state is protected by commit_lock_5 while we hold flush lock above. How is it safe?
i.e., if is_commit_in_progress() returns false and right after that commit is started by some other thread, can we wrongly proceed? and what happens if we proceed.

Remember we said flush_lock is for protecting any changes to the backend file size (either through flush or commit). Are we still following that?

/*
* Get the bcs marked for commit_pending.
*/
if (rpc_api->pvt == nullptr) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we ever expect caller to have already set the bc list?

Comment on lines 2005 to 2007
if (client->mnt_options.nfs_port == 2048) {
csched = stable_write ? CONN_SCHED_FH_HASH : CONN_SCHED_RR;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need this new function, it's confusing.
What we need is simply this in the write task

if (!inode->is_stable_write()) {
    set_csched(CONN_SCHED_RR);
}

basically, what we are saying is if it's an unstable write it can afford to use RR aka multiple connections, else whatever alloc_rpc_task() has chosen, use that.

@linuxsmiths linuxsmiths force-pushed the personal/nitinsingla/commit-with-inline branch from 786b534 to fa05b1d Compare January 30, 2025 00:32
Audit nfs_inode.h
Audit rpc_task.h
@linuxsmiths linuxsmiths force-pushed the personal/nitinsingla/commit-with-inline branch from fa05b1d to 8610721 Compare January 30, 2025 00:35
@linuxsmiths linuxsmiths force-pushed the main branch 5 times, most recently from ed07eba to f024ccb Compare February 19, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants